// Package sysin
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2024 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.13.1
package sysin

import (
	"context"
	"hotgo/internal/model/entity"
	"hotgo/internal/model/input/form"

	"github.com/gogf/gf/v2/frame/g"
)

// StockAbnormalPoolUpdateFields 修改异动股票池字段过滤
type StockAbnormalPoolUpdateFields struct {
	Code             string `json:"code"             dc:"code"`
	Name             string `json:"name"             dc:"name"`
	Date             string `json:"date"             dc:"日期"`
	Zbcs             int    `json:"zbcs"             dc:"炸板次数"`
	LbNumber         int    `json:"lbNumber"         dc:"连板次数"`
	ZtStatisticsDays int    `json:"ztStatisticsDays" dc:"涨停统计-天数范围"`
	ZtStatisticsNum  int    `json:"ztStatisticsNum"  dc:"涨停统计-涨停天数"`
	Industry         string `json:"industry"         dc:"所属行业"`
	Type             int    `json:"type"             dc:"1 强势股 2 次新 3 炸板"`
	NewHigh          int    `json:"newHigh"          dc:"是否新高"`
	SelectedReason   int    `json:"selectedReason"   dc:"1 60日新高 2 60日新高且近期多次涨停"`
	StartDate        string `json:"startDate"   dc:"上市日期"`
}

// StockAbnormalPoolInsertFields 新增异动股票池字段过滤
type StockAbnormalPoolInsertFields struct {
	Code             string `json:"code"             dc:"code"`
	Name             string `json:"name"             dc:"name"`
	Date             string `json:"date"             dc:"日期"`
	Zbcs             int    `json:"zbcs"             dc:"炸板次数"`
	LbNumber         int    `json:"lbNumber"         dc:"连板次数"`
	ZtStatisticsDays int    `json:"ztStatisticsDays" dc:"涨停统计-天数范围"`
	ZtStatisticsNum  int    `json:"ztStatisticsNum"  dc:"涨停统计-涨停天数"`
	Industry         string `json:"industry"         dc:"所属行业"`
	Type             int    `json:"type"             dc:"1 强势股 2 次新 3 炸板"`
	NewHigh          int    `json:"newHigh"          dc:"是否新高"`
	SelectedReason   int    `json:"selectedReason"   dc:"1 60日新高 2 60日新高且近期多次涨停"`
	StartDate        string `json:"startDate"   dc:"上市日期"`
}

// StockAbnormalPoolEditInp 修改/新增异动股票池
type StockAbnormalPoolEditInp struct {
	entity.StockAbnormalPool
}

func (in *StockAbnormalPoolEditInp) Filter(ctx context.Context) (err error) {
	// 验证code
	if err := g.Validator().Rules("required").Data(in.Code).Messages("code不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	// 验证日期
	if err := g.Validator().Rules("required").Data(in.Date).Messages("日期不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	return
}

type StockAbnormalPoolEditModel struct{}

// StockAbnormalPoolDeleteInp 删除异动股票池
type StockAbnormalPoolDeleteInp struct {
	Type int    `json:"type"`
	Date string `json:"date"`
}

func (in *StockAbnormalPoolDeleteInp) Filter(ctx context.Context) (err error) {
	return
}

type StockAbnormalPoolDeleteModel struct{}

// StockAbnormalPoolViewInp 获取指定异动股票池信息
type StockAbnormalPoolViewInp struct {
	Id int `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *StockAbnormalPoolViewInp) Filter(ctx context.Context) (err error) {
	return
}

type StockAbnormalPoolViewModel struct {
	entity.StockAbnormalPool
}

// StockAbnormalPoolListInp 获取异动股票池列表
type StockAbnormalPoolListInp struct {
	form.PageReq
	Id   int `json:"id" dc:"id"`
	Type int `json:"type" dc:"type"`
}

func (in *StockAbnormalPoolListInp) Filter(ctx context.Context) (err error) {
	return
}

type StockAbnormalPoolListModel struct {
	Id               int    `json:"id"               dc:"id"`
	Code             string `json:"code"             dc:"code"`
	Name             string `json:"name"             dc:"name"`
	Date             string `json:"date"             dc:"日期"`
	Zbcs             int    `json:"zbcs"             dc:"炸板次数"`
	LbNumber         int    `json:"lbNumber"         dc:"连板次数"`
	ZtStatisticsDays int    `json:"ztStatisticsDays" dc:"涨停统计-天数范围"`
	ZtStatisticsNum  int    `json:"ztStatisticsNum"  dc:"涨停统计-涨停天数"`
	Industry         string `json:"industry"         dc:"所属行业"`
	Type             int    `json:"type"             dc:"1 强势股 2 次新 3 炸板"`
	NewHigh          int    `json:"newHigh"          dc:"是否新高"`
	SelectedReason   int    `json:"selectedReason"   dc:"1 60日新高 2 60日新高且近期多次涨停"`
	StartDate        string `json:"startDate"   dc:"上市日期"`
}

// StockAbnormalPoolExportModel 导出异动股票池
type StockAbnormalPoolExportModel struct {
	Id                                 int     `json:"id"                                 dc:"id"`
	Code                               string  `json:"code"                               dc:"code"`
	Name                               string  `json:"name"                               dc:"name"`
	Date                               string  `json:"date"                               dc:"日期"`
	Zbcs                               int     `json:"zbcs"                               dc:"炸板次数"`
	LbNumber                           int     `json:"lbNumber"                           dc:"连板次数"`
	ZtStatisticsDays                   int     `json:"ztStatisticsDays"                   dc:"涨停统计-天数范围"`
	ZtStatisticsNum                    int     `json:"ztStatisticsNum"                    dc:"涨停统计-涨停天数"`
	Industry                           string  `json:"industry"                           dc:"所属行业"`
	Type                               int     `json:"type"                               dc:"1 强势股 2 次新 3 炸板"`
	NewHigh                            int     `json:"newHigh"                            dc:"是否新高"`
	SelectedReason                     int     `json:"selectedReason"                     dc:"1 60日新高 2 60日新高且近期多次涨停"`
	StartDate                          string  `json:"startDate"   dc:"上市日期"`
	StockZhASpotEmLastPrice            float64 `json:"stockZhASpotEmLastPrice"            dc:""`
	StockZhASpotEmChangePercent        float64 `json:"stockZhASpotEmChangePercent"        dc:""`
	StockZhASpotEmChangeAmount         float64 `json:"stockZhASpotEmChangeAmount"         dc:""`
	StockZhASpotEmVolume               float64 `json:"stockZhASpotEmVolume"               dc:""`
	StockZhASpotEmTurnover             float64 `json:"stockZhASpotEmTurnover"             dc:""`
	StockZhASpotEmAmplitude            float64 `json:"stockZhASpotEmAmplitude"            dc:""`
	StockZhASpotEmHigh                 float64 `json:"stockZhASpotEmHigh"                 dc:""`
	StockZhASpotEmLow                  float64 `json:"stockZhASpotEmLow"                  dc:""`
	StockZhASpotEmOpen                 float64 `json:"stockZhASpotEmOpen"                 dc:""`
	StockZhASpotEmClosed               float64 `json:"stockZhASpotEmClosed"               dc:""`
	StockZhASpotEmVolumeRatio          float64 `json:"stockZhASpotEmVolumeRatio"          dc:""`
	StockZhASpotEmTurnoverRate         float64 `json:"stockZhASpotEmTurnoverRate"         dc:""`
	StockZhASpotEmPeRatio              float64 `json:"stockZhASpotEmPeRatio"              dc:""`
	StockZhASpotEmPbRatio              float64 `json:"stockZhASpotEmPbRatio"              dc:""`
	StockZhASpotEmMarketCap            float64 `json:"stockZhASpotEmMarketCap"            dc:""`
	StockZhASpotEmCirculatingMarketCap float64 `json:"stockZhASpotEmCirculatingMarketCap" dc:""`
	StockZhASpotEmRiseSpeed            float64 `json:"stockZhASpotEmRiseSpeed"            dc:""`
	StockZhASpotEmChange5Min           float64 `json:"stockZhASpotEmChange5Min"           dc:""`
	StockZhASpotEmChangeErcent60Day    float64 `json:"stockZhASpotEmChangeErcent60Day"    dc:""`
	StockZhASpotEmYtdChangePercent     float64 `json:"stockZhASpotEmYtdChangePercent"     dc:""`
	StockZhASpotEmInflow               float64 `json:"stockZhASpotEmInflow"               dc:"流入"`
	StockZhASpotEmOutflow              float64 `json:"stockZhASpotEmOutflow"              dc:"流出"`
	StockZhASpotEmNetInflow            float64 `json:"stockZhASpotEmNetInflow"            dc:"净流入"`
}
